package com.public_module.tools;

import android.content.Context;
import android.content.SharedPreferences;

//SharedPreferences管理
public  class SharedPreferencesManger {
    public static SharedPreferences sSharedPreferences;
    public static SharedPreferences.Editor sEditor;
    public static String loacl="loacl";
    public static String hostname="hostname";
    public static String cid="cid";
    public static String uname="uname";
    public static String upass="upass";
    public static String realname="realname";
    public static String rem="rem";
    public static String zdyjd="zdyjd";
    public static String uid="uid";
    public static String storeID="storeID";
    public static String storeCode="storeCode";
    public static String storeName="storeName";
    public static String uuid="uuid";

    public static String bmix="bmix";
    public static String bmax="bmax";
    public static String cmix="cmix";
    public static String cmax="cmax";


    public static int getbmix() {
        return sSharedPreferences.getInt(bmix,0);
    }
    public static void setbmix(int str) {
        sEditor.putInt(bmix, str);
        sEditor.commit();
    }

    public static int getbmax() {
        return sSharedPreferences.getInt(bmax,0);
    }
    public static void setbmax(int str) {
        sEditor.putInt(bmax, str);
        sEditor.commit();
    }

    public static int getcmix() {
        return sSharedPreferences.getInt(cmix,0);
    }
    public static void setcmix(int str) {
        sEditor.putInt(cmix, str);
        sEditor.commit();
    }

    public static int getcmax() {
        return sSharedPreferences.getInt(cmax,0);
    }
    public static void setcmax(int str) {
        sEditor.putInt(cmax, str);
        sEditor.commit();
    }







    public static void init(Context context) {
        sSharedPreferences = context.getSharedPreferences("SHARE_KEY", context.MODE_PRIVATE);
        sEditor = sSharedPreferences.edit();;
    }

    public static String getuuid() {
        return sSharedPreferences.getString(uuid,"");
    }

    public static void setuuid(String str) {
        sEditor.putString(uuid, str);
        sEditor.commit();
    }

    public static String getHostName() {
        return sSharedPreferences.getString(hostname,"eid.txykx.com");
    }

    public static void setHostName(String str) {
        sEditor.putString(hostname, str);
        sEditor.commit();
    }

    public static String getCid() {
        return sSharedPreferences.getString(cid,"");
    }

    public static void setCid(String str) {
        sEditor.putString(cid, str);
        sEditor.commit();
    }

    public static String getUname() {
        return sSharedPreferences.getString(uname,"");
    }

    public static void setUname(String str) {
        sEditor.putString(uname, str);
        sEditor.commit();
    }

    public static String getRealName() {
        return sSharedPreferences.getString(realname,"");
    }

    public static void setRealName(String str) {
        sEditor.putString(realname, str);
        sEditor.commit();
    }

    public static String getUpass() {
        return sSharedPreferences.getString(upass,"");
    }

    public static void setUpass(String str) {
        sEditor.putString(upass, str);
        sEditor.commit();
    }

    public static String getUid() {
        return sSharedPreferences.getString(uid,"");
    }

    public static void setUid(String str) {
        sEditor.putString(uid, str);
        sEditor.commit();
    }

    public static String getStoreID() {
        return sSharedPreferences.getString(storeID,"");
    }

    public static void setStoreID(String str) {
        sEditor.putString(storeID, str);
        sEditor.commit();
    }

    public static String getStoreCode() {
        return sSharedPreferences.getString(storeCode,"");
    }

    public static void setStoreCode(String str) {
        sEditor.putString(storeCode, str);
        sEditor.commit();
    }

    public static String getStoreName() {
        return sSharedPreferences.getString(storeName,"");
    }

    public static void setStoreName(String str) {
        sEditor.putString(storeName, str);
        sEditor.commit();
    }

    public static boolean getRem() {
        return sSharedPreferences.getBoolean(rem,false);
    }

    public static void setRem(boolean flag) {
        sEditor.putBoolean(rem, flag);
        sEditor.commit();
    }

    public static boolean getZdyjd() {
        return sSharedPreferences.getBoolean(zdyjd,false);
    }

    public static void setZdyjd(boolean flag) {
        sEditor.putBoolean(zdyjd, flag);
        sEditor.commit();
    }

    public static boolean getLoacl() {
        return sSharedPreferences.getBoolean(loacl,false);
    }

    public static void setLoacl(boolean flag) {
        sEditor.putBoolean(loacl, flag);
        sEditor.commit();
    }
}
